package com.ktjy.service.Impl;

import com.ktjy.dao.NewsDao;
import com.ktjy.pojo.News;
import com.ktjy.service.NewsService;

public class NewsServiceImpl implements NewsService {
//    //所依赖的NewsDao对象
//    private NewsDao newsDao= SimpleDaoFactory.getInstance();
    private NewsDao newsDao;
    public void setDao(NewsDao dao){
        this.newsDao=dao;
    }
    @Override
    public void save(News news) {
        //调用NewsDao的save方法
        newsDao.save(news);
    }
}
